package model

import (
	"gorm.io/gorm"
	"time"
)

type Comments struct {
	CommentId uint           `gorm:"column:comment_id;type:bigint UNSIGNED;comment:评论;primaryKey;not null;" json:"comment_id"` // 评论
	VideoId   uint           `gorm:"column:video_id;type:bigint UNSIGNED;comment:视频id;not null;" json:"video_id"`              // 视频id
	UserId    uint           `gorm:"column:user_id;type:bigint UNSIGNED;comment:用户id;not null;" json:"user_id"`                // 用户id
	Content   string         `gorm:"column:content;type:varchar(255);comment:评论内容;not null;" json:"content"`                   // 评论内容
	LikeCount uint           `gorm:"column:like_count;type:int UNSIGNED;comment:点赞数;not null;" json:"like_count"`              // 点赞数
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);comment:评论时间;not null;" json:"created_at"`              // 评论时间
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (cm *Comments) TableName() string {
	return "comments"
}
